package com.feige.openfeigh;

import com.feige.constant.Constants;
import com.feige.pojo.User;
import com.feige.result.AjaxResult;
import com.feige.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author feige<br />
 * @ClassName: UserService <br/>
 * @Description: <br/>
 * @date: 2021/8/30 20:49<br/>
 */
@Component
@FeignClient(Constants.XIAOFEI_CLOUD_CLASSROOM_CHAT)
public interface UserService {

    /**
     * 保存用户
     * @param user
     * @return
     */
    @PostMapping("/chat/user/save")
    R<User> save(@RequestBody User user);

    /**
     * 通过邮箱查询用户
     * @param email
     * @return
     */
    @GetMapping("/chat/user/get/{email}")
    R<User> getUserByEmail(@PathVariable("email") String email);

    /**
     * 检查邮箱是否授予教师权限
     * @param email
     * @return
     */
    @GetMapping("/chat/user/check/{email}")
    R<String> checkEmailAuthorize(@PathVariable("email") String email);
}
